package example.file;

import java.io.File;

/**
 * Created by lenovo on 2016/11/4 0004.
 * File 类的 listRoots() 方法来输出系统所有根目录
 */
public class ListSysDir {
    public static void main(String[] args) {
        File[] roots = File.listRoots();
        System.out.println("系统所有根目录：");
        for (int i = 0; i < roots.length; i++) {
            System.out.println(roots[i].toString());
        }
    }
}
